def count(str):
    pass


if not count(''):
    print('测试成功')
if count('12abAB[$') == (2, 4, 1, 2):
    print('测试成功')
else:
    print('测试失败')








def count(s):
    digit_count = 0
    letter_count = 0
    space_count = 0
    other_count = 0

    for char in s:
        if char.isdigit():
            digit_count += 1
        elif char.isalpha():
            letter_count += 1
        elif char.isspace():
            space_count += 1
        else:
            other_count += 1

    return digit_count, letter_count, space_count, other_count


if not count(''):
    print('测试成功')
if count('12abAB [s'):
    print('测试成功')
else:
    print('测试失败')
